
#ifndef QOPENCVWIDGET_H
#define QOPENCVWIDGET_H

#include <opencv/cv.h>
#include <QPixmap>
#include <QLabel>
#include <QWidget>
#include <QVBoxLayout>
#include <QImage>
#include <iostream>

/* WebcamVideoPlayer class
 * This class extends a QWidget, and is used to draw frames that have been
 * received from the webcam onto the screen. It can (and does) convert
 * the openCV standard IplImage into a QImage so that it can be drawn to
 * the screen.
 */
class WebcamVideoPlayer : public QWidget
{
    private:
        //variables
        QLabel *imagelabel;
        QVBoxLayout *layout;        
        QImage image;
        
    public:
        //methods
        WebcamVideoPlayer(QWidget *parent = 0);
        QImage convertToQImage(IplImage *cvimage);
        void putImage(IplImage *, int hSize);
        void putImage(QImage* img, int hSize);
        ~WebcamVideoPlayer(void);

}; 

#endif
